﻿CREATE PROCEDURE [dbo].[yaf_eventlog_list](
                @BoardID INT)
AS
    BEGIN
        SELECT   a.*,
                 Isnull(b.[Name],'System')  AS [Name]
        FROM     dbo.yaf_EventLog a
                 LEFT JOIN dbo.yaf_User b
                   ON b.UserID = a.UserID
        WHERE    (b.UserID IS NULL 
          OR b.BoardID = @BoardID)
        ORDER BY a.EventLogID DESC
    END


